Skip to content

Conversation

@yahonda
Copy link
Collaborator

@yahonda yahonda commented Apr 26, 2018

since these methods called via to_sql method under unprepared_statement

Fix #1678

Starting from Oracle enhanced adapter 5.2.0.beta1 most of the queries for the dictionary, such as all_sequences use bind variables by #1498 .
It should help shared memory usage however, which eventually means Oracle enhanced adapter 5.2+ only supports prepared_statements: true
as Rails default configuration but it does not support prepared_statements: false.

Even if prepared_statements: true, to_sql uses unprepared_statement to generate SQL statement. If the connection already knows which table is associated with which model object in advance, to_sql works fine but when to_sql executed first the connection needs to know these relation then call
column_definitionsandpk_and_sequence_for` methods at least.

since these methods called via `to_sql` method under `unprepared_statement`

Fix rsim#1678

Starting from Oracle enhanced adapter 5.2.0.beta1 most of the queries for the dictionary, such as all_sequences use bind variables by rsim#1498 .
It should help shared memory usage however, which eventually means Oracle enhanced adapter 5.2+ only supports `prepared_statements: true`
as Rails default configuration but it does not support `prepared_statements: false`.

Even if `prepared_statements: true`, `to_sql` uses `unprepared_statement` to generate SQL statement. If the connection already knows which table is associated with which model object in advance, `to_sql` works fine but when `to_sql` executed first the connection needs to know these relation then call
column_definitions` and `pk_and_sequence_for` methods at least.
@yahonda yahonda merged commit 331a6fb into rsim:master Apr 26, 2018
@yahonda yahonda deleted the address1678 branch April 26, 2018 23:18
yahonda added a commit to yahonda/oracle-enhanced that referenced this pull request Apr 26, 2018
since these methods called via `to_sql` method under `unprepared_statement`

Fix rsim#1678 Backports rsim#1713 to release52 branch

Starting from Oracle enhanced adapter 5.2.0.beta1 most of the queries for the dictionary, such as all_sequences use bind variables by rsim#1498 .
It should help shared memory usage however, which eventually means Oracle enhanced adapter 5.2+ only supports `prepared_statements: true`
as Rails default configuration but it does not support `prepared_statements: false`.

Even if `prepared_statements: true`, `to_sql` uses `unprepared_statement` to generate SQL statement. If the connection already knows which table is associated with which model object in advance, `to_sql` works fine but when `to_sql` executed first the connection needs to know these relation then call
column_definitions` and `pk_and_sequence_for` methods at least.
yahonda added a commit to yahonda/oracle-enhanced that referenced this pull request Aug 2, 2018
it actually reverts rsim#1503

rsim#1498 implemented prepared statements for dictionary
queries. However rsim#1713 restored non-prepared statements
for `column_definitions` and `pk_and_sequence_for`, which likely have caused
longer elapsed time for these queries reported at rsim#1720

Those who needs 'cursor_sharing = exact' can specify its own value to .database.yml
yahonda added a commit to yahonda/oracle-enhanced that referenced this pull request Aug 7, 2018
it actually reverts rsim#1503

rsim#1498 implemented prepared statements for dictionary
queries. However rsim#1713 restored non-prepared statements
for `column_definitions` and `pk_and_sequence_for`, which likely have caused
longer elapsed time for these queries reported at rsim#1720

Those who needs 'cursor_sharing = exact' can specify its own value to .database.yml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant